package cn.com.java.mapper;

import cn.com.java.model.SysUser;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Optional;

@Mapper
public interface SysUserMapper extends BaseMapper<SysUser> {


    @Select("select s.*,sur.role_id as sysRoleId  from sys_user s left join sys_user_role sur on s.id = sur.user_id "
            )
    List<SysUser> getPageAndRole(Page<SysUser> page, QueryWrapper<SysUser> sysRoleQueryWrapper);

    SysUser getByUserName(String username);

    //Optional<Object> getByUserName(String username);
}